package com.zz.springboot.processor.bag.strategy;

import com.zz.springboot.anno.StrategyKeywords;
import com.zz.springboot.anno.StrategyType;
import com.zz.springboot.constant.TypeConstants;
import com.zz.springboot.initializer.NumDictRunner;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

/**
 * 解析波色策略
 */
@Component
@StrategyType("color")
@StrategyKeywords({"红波", "绿波", "蓝波"})
public class BagColorStrategy implements BagStrategy{
    @Override
    public List<Integer> parseNum(String Key) {
        return NumDictRunner.getColor_Map().get(Key);
    }

    @Override
    public String getKey(String data) {
        for (String target : TypeConstants.colorConstant) {
            if (data.contains(target)) return target;
        }
        return "";
    }
}
